
extension IterableExtension<E> on Iterable<E> {
  /// 带索引的 forEach 扩展函数
  void forEachIndexed(void Function(int index, E element) action) {
    int index = 0;
    for (E element in this) {
      action(index++, element);
    }
  }
}